/*
 * Copyright (c) 2018. paascloud.net All Rights Reserved.
 * 项目名称：paascloud快速搭建企业级分布式微服务平台
 * 类名称：IncrementIdGenerator.java
 * 创建人：刘兆明
 * 联系方式：paascloud.net@gmail.com
 * 开源地址: https://github.com/paascloud
 * 博客地址: http://blog.paascloud.net
 * 项目官网: http://paascloud.net
 */

package com.hyacinth.util.generator;

/**
 * FrameworkID 的保存器.
 *
 * @author gaohongtao
 */
public class IncrementIdGenerator implements IdGenerator {

    private static Long serviceId = null;


    public IncrementIdGenerator(Long oldId) {
        serviceId = oldId + 1;
    }

    @Override
    public Long nextId() {
        return serviceId;
    }

    public static Long getServiceId() {
        return serviceId;
    }

    public static void setServiceId(Long serviceId) {
        IncrementIdGenerator.serviceId = serviceId;
    }

}
